/* eslint-disable jsdoc/no-restricted-syntax */
/**
 * @template {PromiseLike<any>} T
 * @param {string[]} resultQueue
 * @param {{resolve<T>(value?: PromiseLike<T>): T, }} promiseA
 * @returns {Promise<T>}
 */
export function promiseInlay(resultQueue, promiseA) {
  promiseA
    .resolve()
    .then(() => {
      resultQueue.push("1");
    })
    .then(() => {
      resultQueue.push("2");
    })
    .then(() => {
      resultQueue.push("3");
    });
  return promiseA
    .resolve()
    .then(() => {
      resultQueue.push("4");
    })
    .then(() => {
      resultQueue.push("5");
    })
    .then(() => {
      resultQueue.push("6");
    });
}
